var t = getApp(), e = require("../../utils/sendpic.js");
const app = getApp()
var qianzheng = [{ name: "首页" }, { name: "旅游" }, { name: "签证" }, { name: "移民" }, { name: "简历" }, { name: "预留" }, { name: "预留" }, { name: "预留" }, { name: "预留" }, { name: "预留" }]
Page({
  data: {
    look: false,
    formId: "",
    id: "",
    ra1: "",
    ra2: "",
    ra3: "",
    condition: !0,
    img: "../../images/06.png",
    pic: "../../images/20.png",
    hot:[],
    canIu: !1,
    detailUrl: ''
    // rect:,
  },
  hetongclick:function(e){
    console.log(123);
    wx.navigateTo({
      url: '../Draft/detailhetong/detailhetong',
      success: function(res) {},
      fail: function(res) {},
      complete: function(res) {},
    })
  },
  userclick: function () {
  
    let _that = this;
    wx.setStorageSync('htPic', _that.data.detailUrl);
    if (!_that.data.click) {
      _that.setData({
        userclick: false,
        look: false,
        modeluser: false,
        footer: false,
      })
    }
    wx.navigateTo({
      url: '../Draft/userview/userview',
      success: function (res) { },
      fail: function (res) { },
      complete: function (res) { },
    })
  },
  editclick: function (id) {
    // wx.createSelectorQuery().select('#j_page').boundingClientRect(function (rect) {
    let _that = this;
    let pic = id.currentTarget.dataset.url;
    _that.setData({
      detailUrl: pic
    })
    if (!_that.data.click) {
      _that.setData({
        look: true,
      })
    }
    wx.createSelectorQuery().select('#j_page').boundingClientRect(function (rect) {
      // 使页面滚动到底部
      wx.pageScrollTo({
        scrollTop: 1000
      })
    }).exec()
  },
  onLoad: function () {
    var that =this;
    that.fetchBannerList()
    this.setData({
      postdata: qianzheng
    })
    t.GetUrl(), 1 == wx.canIUse("button.open-type.contact") && this.setData({
      canIu: !0
    })

  },
  fetchBannerList:function(){
    var that=this
    wx.request({
      url: "http://127.0.0.1:8082/wx/home/index",
      data:{},
      method:"GET",
      header: {
        "Content-Type": "application/json",
        // Cookie: "PHPSESSID=" + wx.getStorageSync("PHPSESSID")
      },
      success:function(a){
        that.setData({
          postdata: a.data.data.banner,
          hot: a.data.data.hotGoodsList

        })
      }
    })
  }
  
  

  
});